package com.taobao.client.component.templete;
//package com.hotye.gwt.component.templete.client;
//
//import com.google.gwt.http.client.Request;
//import com.google.gwt.http.client.RequestBuilder;
//import com.google.gwt.http.client.RequestCallback;
//import com.google.gwt.http.client.RequestException;
//import com.google.gwt.http.client.Response;
//import com.google.gwt.xml.client.Document;
//import com.google.gwt.xml.client.XMLParser;
//
///**
// * 网页文件的异步请求器
// * @author 雕戈
// * 2008-12-14
// */
//public class XMLAsynchronismLoader {
//
//	public void loadFile(String url, String method,String requestData){
//		RequestBuilder.Method httpMethod = "post".equalsIgnoreCase(method) ? RequestBuilder.POST : RequestBuilder.GET;
//        RequestBuilder builder = new RequestBuilder(httpMethod, url);
//        builder.setHeader("Content-type","application/x-www-form-urlencoded");
//        try {
//			builder.sendRequest(requestData, new RequestCallback(){
//
//				public void onError(Request request, Throwable exception) {
//					
//				}
//
//				public void onResponseReceived(Request request, Response response) {
//					if (response.getStatusCode() == 200) {
//                        Document xml = null;
//                        try {
//                            xml = XMLParser.parse(response.getText());
//                        } catch (Exception e) {
//                        	
//                            return;
//                        }
//					}else{
//						
//					}
//				}
//				
//			});
//		} catch (RequestException e) {
//			e.printStackTrace();
//		}
//	}
//}
